Repository navigation
Claude pool: skip accounts whose seven-day window is spent, also on a fresh instance - #39
Merged
vadymhimself merged 4 commits intoNov 17, 2026
Conversation
… fresh instance Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…nce test helper Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…tead of a new wrapper Co-Authored-By: Claude Opus 5.5 <[email protected]>
… a test's mocked fetch Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
✅ Deterministic PR hygiene checks passed. |
Collaborator
Author
|
Mars security review: GREEN at 9aaef91 (Claude pool skips accounts with a spent seven-day window)
Notes, not blocking:
CI has no failures at this head. |
vadymhimself
merged commit Nov 17, 2026
c49bb29
into
release/2.65.0-vadymhimself.15
107 of 111 checks passed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Claude account pool: never pick an account whose seven-day window is already spent, even on a fresh instance.
Problem: cooldowns live in a per-process map. A gateway that runs as many short-lived instances starts each one empty, so it keeps routing (by hash, affinity or active account) onto accounts that hit their weekly limit, takes a 429, then fails over, sometimes onto another spent account.
Change:
isCooled) now also skips an account whose cached weekly reading is at least 100% with its reset still ahead (weeklyExhaustedUntil). It covers hash, affinity, active, promote and the failover pickers. A 100% reading with no reset fails open.Eval added/updated: tests/adapters/anthropic/anthropic-account-pool.test.ts, new describe "spent seven-day window": fresh instance never picks a spent account (40 session keys); one de-duplicated probe re-routes away from a spent account; probe error or timeout fails open; failover with only spent accounts returns null with the weekly-reset Retry-After. Two existing tests updated (ranking of known 100% vs unknown; failover null when the remaining account is spent), each with a comment.
Not run locally (no bun on the authoring box); CI runs the suite.
🤖 Generated with Claude Code
Reopened from #37 on a
gauge/branch at the same head 9aaef91 (the side sweep only merges<seat>/...branches). Same commit, so ci and independent-qa at this sha carry over.